<template>
  <demoBlock title="上传状态" padding>
    <vcu-uploader v-model="fileList" :after-read="afterRead" />
  </demoBlock>
</template>

<script>
import { defineComponent, ref, getCurrentInstance } from "vue";

export default defineComponent({
  setup() {
    const { proxy } = getCurrentInstance();
    const fileList = ref([
      { url: `${proxy.serverIp}/images/car.jpg`, status: 'uploading', message: "上传中..." },
      { url: `${proxy.serverIp}/images/j20.jpg`, status: 'failed', message: "上传失败" },
    ]);

    const afterRead = (file) => {
      // 此时可以自行将文件上传至服务器
      console.log(file);
    };

    return {
      fileList,
      afterRead,
    };
  },
});
</script>
